package com.shp.service.serviceImpl;

import com.shp.dao.ViewsDao;
import com.shp.pojo.Views;
import com.shp.service.ViewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Description:
 *
 * @author zwl
 * @version 1.0
 * @date 2020/3/19 15:50
 */
@Service(value = "viewsService")
public class ViewsServiceImpl implements ViewsService {

    @Autowired
    private ViewsDao viewsDao;


    /**
     * 保存游客的访问记录
     *
     * @param views 游客访问记录
     * @return 保存成功返回true，否则false
     */
    @Override
    public boolean saveViews(Views views) {
        return viewsDao.insertViews(views) == 1;
    }

    /**
     * 修改游客的访问记录
     *
     * @param views Views
     * @return 修改成功返回true，否则false
     */
    @Override
    public boolean updateViews(Views views) {
        return viewsDao.updateViews(views) == 1;
    }
}
